package com.chinasofti.arrayList;

import java.util.ArrayList;

public class Test {

    public static void main(String[] args) {

        ArrayList<Student> arr = new ArrayList<>();

        Student s1 = new Student("令狐冲",80);
        Student s2 = new Student("岳灵珊",31);
        Student s3 = new Student("风清扬",28);

        arr.add(s1);
        arr.add(s2);
        arr.add(s3);

        for(int i = 0;i<arr.size();i++){
            Student s = arr.get(i);
            System.out.println(s.getName()+ "=" +s.getAge());
        }

    }

}

